package com.ai.ly.goodsautocat.common.wordfilter;

import org.apache.commons.lang3.StringUtils;

import com.ai.ly.goodsautocat.common.AreaNameDict;

public class MiddleWordFilter implements IWordFilter{

    @Override
    public boolean shouldFilterWord(String word) {

        if (StringUtils.isBlank(word)) {
            return true;
        }
        
        //单个文字也过滤吧
        if (word.length()<=1) {
            return true;
        }
        
        //纯标点符号也要过滤
        if (WordFilterUtil.isAllPunc(word)) {
            return true;
        }
        
        //纯数字也过滤吧
        if (WordFilterUtil.isNumber(word)) {
            return true;
        }
        
        //又带英文又带数字的也过滤掉
//        if (WordFilterUtil.isLetterAndNumber(word)) {
//            return true;
//        }
        
        //纯英文并且小于等于2个单词的也要过滤
//        if (WordFilterUtil.is2LengthLetter(word)) {
//            return true;
//        }
        
        //地名也要过滤
        if (AreaNameDict.isAreaName(word)) {
            return true;
        }
        
        return false;
    
    }
    
}
